#ifndef QLIB_LIBRARYTREEITEM_H
#define QLIB_LIBRARYTREEITEM_H

#include <QTreeWidgetItem>

class QedaLibrary;
class QedaComponent;

class LibraryTreeItem : public QTreeWidgetItem
{
public:
    enum ItemType
    {
        LibraryItem = UserType + 1,
        GroupItem = UserType + 2,
        ReferenceItem = UserType + 3,
        ComponentItem = UserType + 4
    };
    LibraryTreeItem(int type = Type);
    LibraryTreeItem(QTreeWidget *parent, const QStringList &strings, int type = Type);
    LibraryTreeItem(QTreeWidgetItem *parent, const QStringList &strings, int type = Type);

    QedaLibrary *library();
    QedaComponent *component();
    void setObject(QObject *obj) { m_object = obj; }

    bool isLibrary() { return (type() == LibraryItem); }
    bool isGroup() { return (type() == GroupItem); }
    bool isReference() { return (type() == ReferenceItem); }
    bool isComponent() { return (type() == ComponentItem); }

private:
    QObject     *m_object;
};

#endif // QLIB_LIBRARYTREEITEM_H
